public class PlayerMeleeAttack1State : PlayerState
{
    public PlayerMeleeAttack1State(PlayerFSM manager, string animationName) : base(manager, animationName) { }

    public override void OnEnter()
    {
        base.OnEnter();
        //移动补偿
        SetVelocity(parameter.attackMovePostion.x * parameter.facingDirection, parameter.attackMovePostion.y);
    }

    public override void OnUpdate()
    {
        base.OnUpdate();
        if (parameter.isHurt)
        {
            manager.TransitionState(StateType.Hit);
        }
        if(parameter.isClimb){
            manager.TransitionState(StateType.ClimbBegin);
        }
        if (parameter.isDash)
        {
            manager.TransitionState(StateType.Dash);
        }

        if (PlayComplete())
        {
            if (parameter.isMeleeAttack)
            {
                manager.TransitionState(StateType.MeleeAttack2);
            }else{
                manager.TransitionState(StateType.Idle);
            } 
        }

        if(parameter.isClickMeleeAttack) parameter.isMeleeAttack = true;
    }

    public override void OnFixedUpdate()
    {
        base.OnFixedUpdate();
    }

    public override void OnExit()
    {
        base.OnExit();
        //攻击执行完可以转向，比如第二段攻击往后打，手感更好
        manager.FlipTo();
        parameter.isMeleeAttack = false;
    }
}
